﻿using System;
using ASquared.SymbolicMath; 

namespace ASquared.ModelOptimization
{
    /// <summary>Defines a function that is solvable according to the conditional gradient method.</summary>
    public interface IConditionalGradientSolvableFunction
    {
        // Initialization
        /// <summary>Initializes the function.</summary>
        void Initialize();

        // Nonlinear function
        /// <summary>Defines the nonlinear objective function.</summary>
        Symbol fxn { get; }
        /// <summary>Gets and sets a masking matrix that contains 1's at indices for variables used within fxn and 0's everywhere else.</summary>
        Matrix variableMask { get; }

        // Linear optimization interaction
        /// <summary>Gets and sets costs associated with each decision variable. This is a vector.</summary>
        Matrix costs { get; set; }
        /// <summary>Gets and sets decision variable values after an iteration of the model. This is a vector.</summary>
        Matrix decisions { get; set; }
        /// <summary>Gets all the variables by name in the same order as the decisions.</summary>
        String[] variables { get; }
        /// <summary>Gets the constraint coefficient matrix</summary>
        Matrix A { get; }
        /// <summary>Gets the right-hand side of the constraints</summary>
        Matrix b { get; }
        /// <summary>Gets an array specifying variable types associated with each of the variables.</summary>
        VariableType[] VariableTypes { get; }
        /// <summary>Gets an array specifying constraint types associated with each of the constraints.</summary>
        ConstraintType[] ConstraintTypes { get; }

        // Convergence
        /// <summary>Gets and sets a value specifying whether or not the optimization has converged</summary>
        bool IsConverged { get; set; }

    }
}
